<?php

/**
 * 小程序服务商管理系统 v1.0.1
 *
 * 商业运营到axzz.cn官网进行授权使用。
 *
 * (c) cighsen02 <xiayu@959602.com>
 *
 * Create at：2025.03.21
*/

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Services\Role\User as UserRole;
use App\Services\Auth\User as UserService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Exceptions\JsonDecodeException;

/**
 * 会员面板中心
 */
class DashboardController extends Controller
{
    /**
     * 列表
     *
     * @param UserService $user
     * @return JsonResponse
     */
    public function index(Request $request, UserService $user): JsonResponse
    {
        // roles()
        $user = $request->user();
        // $user->permissions();
        // $user->getPermissionsViaRoles();
        $allPermissions = $user->getAllPermissions();
        // dd($allPermissions->pluck('name'));

        return $this->sendResponse($user, 'success');
    }
}
